Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 5 - Option Management / Option Management Reference
Constants and Data Types


The TOption Structure

The TOption structure stores information about a single option in a buffer. All functions that you use to change or verify option values use a buffer containing TOption structures to store option information. For each option in the buffer, the TOption structure specifies the total length occupied by the option information, the protocol level of the option, the option name, the success or failure of a negotiated value, and the value of the option.

You use the TOption structure with the OPT_NEXTHDR macro, the OTCreateOptionString function, the OTNextOption function, and the OTFindOption function.

The TOption structure is defined by the TOption data type.

struct TOption
   {
      UInt32      len;     /* total length of option */                 
      OTXTILevel  level;   /* protocol affected */
      OTXTIName   name;    /* option name */
      UInt32      status;  /* status value */
      UInt32      value[1];/* data goes here */
   };
Field Description
len
The size (in bytes) of the option information.
level
The protocol for which the option is defined.
name
The name of the option.
status
A status code specifying whether the negotiation has succeeded or failed. Possible values are given by the status codes enumeration, (page 5-29).
value
The option value. To have the endpoint select an appropriate value, you can specify the constant T_UNSPEC.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996